package com.woniuxy.microfixeddepositserver.controller;

import com.alibaba.fastjson.JSONObject;
import com.woniuxy.bean.ResultBean;
import com.woniuxy.microfixeddepositserver.bean.RiskGradeBean;
import com.woniuxy.microfixeddepositserver.service.IRiskGradeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: masterhai
 * @date: 2021/4/9:12:11
 * @description:
 */
@RefreshScope
@RestController
@Slf4j
@RequestMapping(value = "/riskGrade", produces = {"application/json;charset=utf-8"})
public class RiskGradeController {
    @Resource
    private IRiskGradeService riskGradeService;

    /**
     * 查询风险等级信息
     *
     * @return
     */
    @PostMapping("info")
    public ResultBean selectAll () {
        List<RiskGradeBean> riskGradeBeans = riskGradeService.selectAll();
        return ResultBean.builder().code(200).msg("查询风险等级数据成功").data(riskGradeBeans).build();
    }

}
